﻿using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;
using Castle.Components.Validator;
using MiragePWF.NH.Validation;
using Wolfut.MirageEE.Kernal.Common;
using Wolfut.MirageEE.Domain.CommonUtilities;

namespace Wolfut.MirageEE.Domain.Common
{
    [ActiveRecord("PROJECTS")]
    public class Project : PersistentObjectWithGuid
    {
        #region 项目编号
        /// <summary>
        /// 项目编号
        /// </summary>
        [Property("PROJECT_CODE")]
        [ValidateIsUnique("数据库已经存在相同的项目编号！")]
        [ValidateNonEmpty, ValidateLength(0, 100, "项目编号超长！")]
        public virtual string ProjectCode
        {
            get
            {
                return projectCode;
            }
            set
            {
                projectCode = value;
            }
        }
        private string projectCode;
        #endregion

        #region 项目名称
        /// <summary>
        /// 项目名称
        /// </summary>
        [Property("PROJECT_NAME")]
        [ValidateNonEmpty, ValidateLength(0, 40, "项目名称超长！")]
        public virtual string ProjectName
        {
            get
            {
                return projectName;
            }
            set
            {
                projectName = value;
            }
        }
        private string projectName;
        #endregion

        #region 预算收入
        /// <summary>
        /// 预算收入
        /// </summary>
        [Property("BUDGET_INCOME")]
        public virtual Decimal  BudgetIncome
        {
            get
            {
                return budgetIncome;
            }
            set
            {
                budgetIncome = value;
            }
        }
        private Decimal budgetIncome;
        #endregion

        #region 预算成本
        /// <summary>
        /// 预算成本
        /// </summary>
        [Property("BUDGET_COST")]
        public virtual Decimal BudgetCost
        {
            get
            {
                return budgetCost;
            }
            set
            {
                budgetCost = value;
            }
        }
        private Decimal budgetCost;
        #endregion
        
        #region 预算收入差额
        /// <summary>
        /// 预算收入差额
        /// </summary>
        [Property("BUDGET_INCOME_BALANCE")]
        public virtual Decimal BudgetReceiptBalance
        {
            get
            {
                return budgetReceiptBalance;
            }
            set
            {
                budgetReceiptBalance = value;
            }
        }
        private Decimal budgetReceiptBalance;
        #endregion

        #region 预算成本差额
        /// <summary>
        /// 预算成本差额
        /// </summary>
        [Property("BUDGET_COST_BALANCE")]
        public virtual Decimal BudgetCostBalance
        {
            get
            {
                return budgetCostBalance;
            }
            set
            {
                budgetCostBalance = value;
            }
        }
        private Decimal budgetCostBalance;
        #endregion

        #region 开工日期
        /// <summary>
        /// 开工日期
        /// </summary>
        [Property("START_DATE")]
        public virtual DateTime StartDate
        {
            get
            {
                return startDate;
            }
            set
            {
                startDate = value;
            }
        }
        private DateTime startDate;
        #endregion

        #region 完工日期
        /// <summary>
        /// 完工日期
        /// </summary>
        [Property("COMPLETE_DATE")]
        public virtual DateTime EndDate
        {
            get
            {
                return endDate;
            }
            set
            {
                endDate = value;
            }
        }
        private DateTime endDate;
        #endregion    

        #region 计算日期
        /// <summary>
        /// 计算日期
        /// </summary>
        [Property("COMPUTE_DATE")]
        public virtual DateTime ComputeDate
        {
            get
            {
                return computeDate;
            }
            set
            {
                computeDate = value;
            }
        }
        private DateTime computeDate;
        #endregion    

        #region 备注
        /// <summary>
        /// 备注
        /// </summary>
        [Property("REMARKS")]
        [ValidateLength(0, 2000, "备注超长！")]
        public virtual string Remark
        {
            get
            {
                return remark;
            }
            set
            {
                remark = value;
            }
        }
        private string remark;
        #endregion

        #region 逻辑删除
        private Boolean isDeleted;
        /// <summary>
        /// 逻辑删除
        /// </summary>
        [Property("IS_DELETED")]
        public virtual Boolean IsDeleted
        {
            get
            {
                return isDeleted;
            }
            set
            {
                isDeleted = value;
            }
        }
        #endregion
    }
}
